package com.bingyuan.aipassproject.view.adapter

import android.widget.ImageView
import com.bingyuan.aipassproject.R
import com.bingyuan.aipassproject.entity.SendDetailResponse
import com.bingyuan.aipassproject.utils.loadCircularImage
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder


class GetRobsAdapter :
    BaseQuickAdapter<SendDetailResponse.RobsBean, BaseViewHolder>(R.layout.item_get_robs) {
    override fun convert(holder: BaseViewHolder, item: SendDetailResponse.RobsBean) {
        val ivIcon = holder.getView<ImageView>(R.id.ivListIcon)
        if (item.user.face.equals("false")) {
            ivIcon.loadCircularImage(R.drawable.icon_csc, 0, context)
        } else {
            ivIcon.loadCircularImage(item.user.face, 0, context)
        }
        holder.setText(R.id.tvUserName, item.user.nickname)
        holder.setText(R.id.tvDate, item.rob_time)
        if (item.claim_score.equals("0.00")) {
            holder.setText(R.id.tvNum, item.rob_time)
        } else {
            holder.setText(R.id.tvNum, "-" + item.claim_score)
        }

    }
}